﻿# -*- coding: utf-8 -*-
#按照公共模块需求，添加的消息结构定义
CMD_MAP = {
    #游戏模式信息
    "game_sc_game_mode" : {
        "mode" : "B",
        "stage" : "I",
        "master" : "B",
        #"_type" : S_GAME_MODE,
        }, \
    #玩家进入（发送用户进入信息）
    #客户端可以选择忽略
    "game_sc_player_in" : {
        "side" : "B",
        "urs" : "s",
        "uid" : "I",
        "nickname" : "s",
        "is_ready" : "B",
        "gmlvl" : "I",
        #"_type" : S_USER_IN_GAME,
        }, \
    #玩家退出
    "game_sc_player_out" : {
        "side" : "B",
        "uid" : "I",
        #"_type" : S_USER_OUT_GAME,
        }, \
    #准备/取消准备
    "game_cs_game_ready" : {
        "is_ready" : "B",
        #"_type" : C_GAME_READY,
        }, \
    #准备/取消准备(某个用户的状态改变了)
    "game_sc_game_ready" : {
        "side" : "B",
        "is_ready" : "B",
        #"_type" : S_GAME_READY,
        }, \
    #游戏准备(关卡)信息发送
    "game_sc_game_init" :{
        "stage" : "I",
        #"_type" : S_GAME_INIT,
        }, \
    #只含有一个int数的包，用于实现打包中出现不定长的int组成的list
    "game_single_int" : {
        "value" : "i",
        #"_type" : SINGLE_INT,
        }, \
    #客户端发送带入植物种类
    "game_c_game_init" : {
        "card_list" : "game_single_int",
        #"_type" : C_GAME_INIT,
        }, \
    #游戏开始的时候群发的游戏玩家初始化信息
    "game_player_start_info" : {
        "side" : "B",
        "energy" : "i",
        "faction" : "B",
        "card_list" : "game_single_int",
        #"_type" : PLAYER_START_INFO,
        }, \
    #游戏开始(用户开始)
    "game_sc_game_start" : {
        "stage" : "I",
        "player_list" : "game_player_start_info",
        #"_type" : S_GAME_START,
        }, \
    #游戏具体事件（客户端）
    "game_cs_game_event" : {
        "frame" : "I",
        "event_id" : "H",
        "param" : "s",
        #"_type" : C_GAME_EVENT,
        }, \
    #游戏具体事件（服务端）
    "game_sc_game_event" : {
        "frame" : "I",
        "event_id" : "H",
        "param" : "s",
        #"_type" : S_GAME_EVENT,
        }, \
    #单个玩家的游戏结果(用于游戏结束的结算)
    "game_player_end_info" : {
        "side" : "B",
        "rank" : "B",
        "score" : "i",
        "killed" : "i",
        #"_type" : PLAYER_END_INFO,
        }, \
    #游戏结束和本局游戏结果
    "game_sc_game_end" : {
        "win" : "B",
        "stage" : "I",
        "player_list" : "game_player_end_info",
        #"_type" : S_GAME_END,
        }, \
    #离开房间
    "game_cs_leave_game" : {
        "no_use" : "B",
        #"_type" : C_LEAVE_GAME,
        }, \
    #只是为了兼容
    'hw_cs_leave_room': {
    },\
    #玩家具体信息
    "game_sc_player_detail_info" : {
        "side" : "B",
        "score" : "i",
        "_win" : "I",
        "_lose" : "I",
        "_draw" : "I",
        "_break" : "I",
        "avatar" : "s",
        "pet" : "s",
        #"_type" : S_PLAYER_DETAIL_INFO,
        }, \
    #玩家隐私信息，由于只会收到自己的，所以没有side信息
    "game_sc_player_secret_info" : {
        "yuanbao" : "i",
        "yuanbao_free" : "i",
        "finish_stage" : "game_single_int",###不定长，与finish_achieve对应
        "finish_achieve" : "game_single_int",
        #"_type" : S_PLAYER_SECRET_INFO,
        }, \
    #玩家完成的成就id
    "game_sc_player_finish_achieve" : {
        "achieve_id" : "I",
        #"_type" : S_PLAYER_FINISH_ACHIEVE,
        }, \
        
    #暂时作为一个event事件，在room处做
    'game_sc_change_score': {
        'delta_score': 'i',
        'current_score': 'i',
    },\
    'game_cs_change_score': {
        'delta_score': 'i',
    },\
    #接收到其它的用户的更新分数消息
    'player_sc_update_score': {
        'uid':'I',
        'current_score': 'i',
    },\
    ###辅助定义的一个消息不做特别的规定
    'player_sc_send_error_code':{
        'uid':'I',
        'current_score':'i',
    },\
}